import request from '@/utils/request.js'

// 获取地址列表   /lejuAdmin/companyAddress/addressList
function addressList(data) {
  return request({
    url: '/lejuAdmin/companyAddress/addressList',
    data: {
      id: 1
    }
  })
}
// 新增地址  /lejuAdmin/companyAddress/save
function save(data) {
  return request({
    url: '/lejuAdmin/companyAddress/save',
    method: 'post',
    data
  })
}
// 更新地址  /lejuAdmin/companyAddress/update
function update(data) {
  return request({
    url: '/lejuAdmin/companyAddress/update',
    method: 'post',
    data
  })
}
// 设置收货地址默认  /lejuAdmin/companyAddress/setReceiveOne
function setReceiveOne(data) {
  return request({
    url: 'lejuAdmin/companyAddress/setReceiveOne', method: 'post',
    data
  })
}
// 设置发货地址默认  /lejuAdmin/companyAddress/setSendOne
function setSendOne(data) {
  return request({
    url: '/lejuAdmin/companyAddress/setSendOne', method: 'post',
    data
  })
}
// 删除地址  /lejuAdmin/companyAddress
function companyAddress(id) {
  return request({
    url: `/lejuAdmin/companyAddress/${id}`,
    method: 'DELETE'
  })
}

export {
  addressList,
  save,
  update,
  setReceiveOne,
  setSendOne,
  companyAddress
}
